/**
 * 
 */
package com.java.controller.admin;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Map;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.swing.plaf.basic.BasicInternalFrameTitlePane.IconifyAction;
import javax.validation.constraints.Pattern.Flag;

import org.apache.ibatis.javassist.expr.NewArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.java.entity.Good;
import com.java.entity.Order;
import com.java.entity.Payment;
import com.java.entity.User;
import com.java.service.impl.GoodServiceImpl;
import com.java.service.impl.ImageServiceImpl;
import com.java.service.impl.OrderServiceImpl;
import com.java.service.impl.PaymentServiceImpl;
import com.java.service.impl.UserServiceImpl;

/**
* @author Kidney
* 创建时间：2019年2月20日 下午5:51:46
* Description:
*/
/**
 * @author KIDNEY
 *
 */

@Controller
@RequestMapping("/kuaidi/")
public class KuaidiController {

	@Autowired
	private GoodServiceImpl gsl;

	@Autowired
	private UserServiceImpl us;

	@Autowired
	private OrderServiceImpl os;

	@Autowired
	private PaymentServiceImpl ps;


	@RequestMapping("update")
	public ModelAndView ssss(Integer id, Integer number) {
		ModelAndView mav = new ModelAndView();	
		
		mav.setViewName("/pages/front/addexpressnum.jsp");// 付款成功界面
		
		Payment payment  = new Payment();
		payment.setPaymentId(id);
		payment.setExpressNum(number);
		
		int flag = ps.updateByPrimaryKeySelective(payment);		
		
		String status = "fail";
		
		if(flag==1) {
			status="sccess";
		}
		
		
		mav.getModel().put("status", status);
		
		return mav;

	}
	
	
	
}
